package edu.hsbremen.teamscore.activities;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import edu.hsbremen.teamscore.R;

public class Descriptions extends Activity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.description);

		Intent intend = getIntent();
		
		String game = intend.getExtras().getString("game");
		TextView headLine = (TextView) findViewById(R.id.desc_head);
		TextView mainText = (TextView) findViewById(R.id.desc_text);
		Button backbtn = (Button) findViewById(R.id.desc_back_btn);

		backbtn.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				finish();			
			}
		});
		
		
		if(game.equals("tennis")){
			headLine.setText("Tennis Rules");
			mainText.setText(R.string.rulestennis);
		} else if (game.equals("floorball")){
			headLine.setText("Floorball Rules");
			mainText.setText(R.string.rulesfloorball);
		} else if(game.equals("soccer")){
			headLine.setText("Soccer Rules");
			mainText.setText(R.string.rulessoccer);
		} else if(game.equals("basketball")){
			headLine.setText("Basketball Rules");
			mainText.setText("This is still to be done");
		} else {
			headLine.setText("NULL");
			mainText.setText("NULL");
		}
		
	}

}
